package com.study.mybatisplus.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.study.mybatisplus.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 用户 Mapper 接口
 * </p>
 *
 * @author yuanZhi
 * @since 2020-05-15
 */

@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from t_user ${ew.customSqlSegment}")
    List<User> getAllByType(@Param(Constants.WRAPPER) Wrapper wrapper);

    @Select("select * from t_user ${ew.customSqlSegment}")
    List<User> getAll(@Param(Constants.WRAPPER) Wrapper wrapper);

//    Page<User> getPage();

    IPage<User> getPage(Page page);
}
